package com.niiwoo.activity.stage.enums.cashactivity;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ActivityProjectTypeEnum {

    SPEED_BORROW((byte) 1, "极速借", Byte.valueOf("1")),
    CARD_BRROW((byte) 2, "卡贷", Byte.valueOf("4")),

    SMALL_LOAN((byte) 4, "小易借", Byte.valueOf("8")),
    SOCIAL_SECURITY_LOAN((byte) 5, "社保借", Byte.valueOf("9")),
    CREDIT_CARD_LOAN((byte) 6, "信用卡借", Byte.valueOf("10")),

    ORG_SPEEDLOAN_NEW((byte) 7, "极速借机构新", Byte.valueOf("11")),

    ALL((byte) 3, "全部", null);

    private Byte code;
    private String desc;
    private Byte eventProjectCode;

    public static ActivityProjectTypeEnum getByEventCode(Byte eventProjectCode) {
        for (ActivityProjectTypeEnum typeEnum : ActivityProjectTypeEnum.values()) {
            if (typeEnum.getEventProjectCode() != null && typeEnum.getEventProjectCode().equals(eventProjectCode)) {
                return typeEnum;
            }
        }
        return null;
    }
}
